<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>患者详情信息</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <style>
        .patient-list-fix-bottom {
            width: 100%;
        }

        body {
            background-color: foo;
            height: auto;
        }

        .patient-list-fix-bottom>div {
            display: -webkit-flex;
            display: flex;
            justify-content: space-around;
            align-items: center;
            height: 42px;
            line-height: 42px;
        }

        .patient-list-fix-bottom>div>div {
            width: 33%;
            text-align: center;
            height: 42px;
            line-height: 42px;
        }

        .patient-list-fix-bottom>div>div>span {
            float: left;
            display: inline-block;
        }

        .patient-list-fix-bottom>div>div>span:nth-child(1) {
            width: 60%;
            text-align: left;
            display: block;
        }

        .patient-list-fix-bottom>div>div>span:nth-child(2) {
            width: 40%;
            text-align: left;
            display: block;
        }
    </style>
</head>

<body>
    <main id="app">
        <section class="patient-list-fix-bottom" id="EssentialInformation" @touchmove.prevent.stop>
            <div>
                <div>
                    <span>住院编号：</span>
                    <span id="F_zhuyuannumber"></span>
                </div>
                <div>
                    <span>姓名：</span>
                    <span id="F_paientname"></span>
                </div>
            </div>
            <div>
                <div>
                    <span>手机号码：</span>
                    <span id="F_patientphone"></span>
                </div>
                <div>
                    <span>性别：</span>
                    <span id="F_patientsex"></span>
                </div>
            </div>
            <div>
                <div>
                    <span>出生日期：</span>
                    <span id="F_Birthday"></span>
                </div>
                <div>
                    <span>患者诊断：</span>
                    <span id="F_patientdiagnose"></span>
                </div>
            </div>
        </section>
        <div class="aui-tab" id="tab">
            <div class="aui-tab-item aui-active" id="a">
                评估书
            </div>
            <div class="aui-tab-item" id="b">
                治疗记录单
            </div>
            <div class="aui-tab-item" id="c">
                医嘱
            </div>
            <div class="aui-tab-item" id="d">
                电子病历
            </div>
            <div class="aui-tab-item" id="e">
                同意书
            </div>
            <div class="aui-tab-item" id="f">
                病程记录
            </div>
        </div>
    </main>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script src="../script/vue.js" charset="utf-8"></script>
<script src="../js/ToConfigure.js" charset="utf-8"></script>
<script type="text/javascript" src="../script/aui-tab.js"></script>

<script type="text/javascript">
    apiready = function() {

        //接收患者ID
        var F_ID = api.pageParam.F_ID;
        PatientInformation();

        //患者基本信息
        function PatientInformation() {

            //获取所属医院IP地址
            var Url_IP = ToConfigure_IP("Gorgeous");
            //查询患者基本信息
            var Query_JsParms = new Object();
            //获取患者预约ID
            Query_JsParms.F_ID = F_ID;
            if (Query_JsParms.F_Id !== '' || Query_JsParms.F_Id !== undefined) {
                //转换为json数据
                var JsonStr = JSON.stringify(Query_JsParms);

                api.ajax({
                    url: Url_IP + 'AppointmentRegistration/Query_AppointmentRegistrationPB',
                    method: 'get',
                    dataType: 'json',
                    data: {
                        values: {
                            parms: JsonStr
                        },
                    }
                }, function(ret, err) {
                    if (ret) {
                        //赋值页面
                        if (ret !== null && ret !== '') {
                            document.getElementById('F_zhuyuannumber').innerHTML = ret[0]['F_zhuyuannumber'];
                            document.getElementById('F_paientname').innerHTML = ret[0]['F_paientname'];
                            document.getElementById('F_patientphone').innerHTML = ret[0]['F_patientphone'];
                            document.getElementById('F_patientdiagnose').innerHTML = ret[0]['F_patientdiagnose'];
                            document.getElementById('F_Birthday').innerHTML = ret[0]['F_Birthday'];
                            document.getElementById('F_patientsex').innerHTML = ret[0]['F_patientsex'];
                        }
                    }
                })
            }

        }


        //tab页操作
        header = $api.offset($api.byId('EssentialInformation')).h + 10;
        api.openFrameGroup({
            name: 'siji',
            rect: {
                x: 0,
                y: 260,
                w: 'auto',
                h: 'auto'
            },
            frames: [{
                name: 'Patient_Assessment',
                url: 'Patient_Assessment.html',
                bgColor: '#fff',
                pageParam: {
                    F_ID: F_ID
                }
            }, {
                name: 'Patient_TreatmentRecord',
                url: 'Patient_TreatmentRecord.html',
                bgColor: '#fff',
                pageParam: {
                    F_ID: F_ID
                }
            }, {
                name: 'Patient_DoctorsAdvice',
                url: 'Patient_DoctorsAdvice.html',
                bgColor: '#fff',
                pageParam: {
                    F_ID: F_ID
                }
            }, {
                name: 'Patient_MedicalRecord',
                url: 'Patient_MedicalRecord.html',
                bgColor: '#fff',
                pageParam: {
                    F_ID: F_ID
                }
            }, {
                name: 'Patient_InformedConsent',
                url: 'Patient_InformedConsent.html',
                bgColor: '#fff',
                pageParam: {
                    F_ID: F_ID
                }

            }, {
                name: 'Patient_ConditionRecord',
                url: 'Patient_ConditionRecord.html',
                bgColor: '#fff',
                pageParam: {
                    F_ID: F_ID
                }
            }]
        }, function(ret, err) {
            var index = ret.index;
            $api.removeCls($api.byId('a'), 'aui-active');
            $api.removeCls($api.byId('b'), 'aui-active');
            $api.removeCls($api.byId('c'), 'aui-active');
            $api.removeCls($api.byId('d'), 'aui-active');
            $api.removeCls($api.byId('e'), 'aui-active');
            if (index == 0) {
                $api.addCls($api.byId('a'), 'aui-active');
            } else if (index == 1) {
                $api.addCls($api.byId('b'), 'aui-active');
            } else if (index == 2) {
                $api.addCls($api.byId('c'), 'aui-active');
            } else if (index == 3) {
                $api.addCls($api.byId('d'), 'aui-active');
            } else if (index == 4) {
                $api.addCls($api.byId('e'), 'aui-active');
            }
        });
    };
    var tab = new auiTab({
        element: document.getElementById("tab"),
    }, function(ret) {
        //                                                console.log(ret)
        api.setFrameGroupIndex({
            name: 'siji',
            index: ret.index - 1
        });
    });

    function goback() {
        api.closeWin({});
    }
</script>

</html>
